/*
 * Copyright (c) 2001-2023 cnstrong.cn Corporation Limited. All rights reserved.
 * This software is the confidential and proprietary information of cnstrong.cn Company.
 * ("Confidential Information").
 * You shall not disclose such Confidential Information and shall use it only
 * in accordance with the terms of the license agreement you entered into with cnstrong.cn.
 */
package com.tree.config.mapper;

import com.tree.config.repository.dataobject.ProjectConfigDefineDO;
import com.tree.config.repository.po.ProjectConfigDefineExtendPO;
import com.tree.config.repository.po.ProjectConfigDefinePO;

import java.util.List;

/**
 * 项目配置mapper
 *
 * @author Braveheart
 * @version V1.0
 * @since 2023-12-29
 */
public interface MicrodomainProjectConfigDefineMapper {

    int insertSelective(ProjectConfigDefineDO record);

    ProjectConfigDefineDO selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(ProjectConfigDefineDO record);

    List<ProjectConfigDefineDO> selectConfigDefine(ProjectConfigDefinePO projectConfigDefinePO);

    List<ProjectConfigDefineDO> listByCfgCodeSubConfigDefine(ProjectConfigDefinePO projectConfigDefinePO);

    List<ProjectConfigDefineDO> listByProjectCode(ProjectConfigDefinePO projectConfigDefinePO);

    List<ProjectConfigDefineDO> listExtendByProjectCode(ProjectConfigDefineExtendPO projectConfigDefineExtendPO);

    int logicDelete(Long id);

    /**
     * 查询项目下共有几组 cfgCode1，用于限制cfgCode1 数量
     */
    Integer listCountCfgCode1CodeByProjectCode(String projectCode);

    /**
     * 查询项目和 cfgCode1 下共有几组 cfgCode2，用于限制 cfgCode2 数量
     */
    Integer listCountCfgCode2CodeByProjectCode(String projectCode, String cfgCode1);

    /**
     * 查询项目 cfgCode1 cfgCode2 下共有几组 cfgCode3，用于限制 cfgCode3 数量
     */
    Integer listCountCfgCode3CodeByProjectCode(String projectCode, String cfgCode1, String cfgCode2);
}
